import request from './http'

//创建购买记录
export const create = params => {
    console.log(params);
    return request({
        url:'/records/create',
        method:'post',
        data:params
    })
}

//获取用户购买清单
export const list = params => {
    return request({
        url:'/records/list',
        method:'get',
        params
    })
}

//获取用户购买记录
export const record = params => {
    return request({
        url:'/records/record',
        method:'get',
        params
    })
}

//删除顶单
export const deleteBorrow = params => {
    return request({
        url:'/records/delete',
        method:'post',
        data:params
    })
}

//下单
export const confirmBorrow = params => {
    return request({
        url:'/records/confirm',
        method:'post',
        data:params
    })
}

export const borrow = params => {
    return request({
        url:'/records/borrow',
        method:'post',
        data:params
    })
}

//确认收货
export const returnBook = params => {
    return request({
        url:'/records/returnBook',
        method:'post',
        data:params
    })
}